<template>
  <div class="cPage">
    <div class="edit">
      <Edit v-if="isShow" :originForm="originForm" />
    </div>
  </div>
</template>
<script>
import Edit from "./edit";

export default {
  components: {
    Edit,
  },
  data() {
    return {
        isShow: false,
      // 表单相关
      originForm: {
        topUrl: "",
        descUrl: "",
        desc: "",
        address: "",
        contactList: [
          { type: "微信", name: "需求报道", contact: "jingjing2020" },
          { type: "微信", name: "商务合作", contact: "chenliang" },
          { type: "邮箱", name: "邮箱", contact: "iot101@163.com" },
          { type: "电话", name: "电话", contact: "010-123456" },
        ],
        cooperationList: [{ name: "网易新闻", url: "www.163.com" }],
      },
    };
  },
  methods: {},
  created() {
    const ajaxType = "get";
    const url = "/api/plat/setting.json";
    const params = {
      key: "cooperationManageData",
    };
    this.$axios[ajaxType](url, {params}).then((response) => {
      const res = response.value
      if(res) this.originForm = JSON.parse(res);
      this.isShow = true
    });
  },
};
</script>
<style lang="scss" scoped>
.cPage {
  padding: 30px 15px;
}
.edit {
  margin: 0px 40px 0 0;
}
</style>
